import pandas as pd

cols = ['devid','hostid', 'time', 'lat', 'lon', 'alt', 'speed', 'ang',
'sat', 'acc', 'vol', 'warn', 'rectm', 'gwid', 'type',
'eventType', 'mtime', 'detail']
df = pd.DataFrame(columns=cols)
# df.ix[0, 'A'] ="hello"
# df.ix[0, 'B'] ="hello world"
# df.loc[0] = ['hello', 'hello,world']
df.loc[0] = ['3870010406', '0', '2016-11-24 11:07:31', '34.23084', '117.178608', '71', '8.600000381469727', '140.0', '9', '1',
     '28.0', '0', '2016-11-24 11:07:37', 'gw234', '0', '2', '2016-11-24 11:07:31',
     '{"reason":"震动唤醒","accelerateX":-327.63,"resonType":3,"accelerateY":0.06,"accelerateZ":0.02}']

df.to_csv("/bkdata/tmp/test.csv")
print(df.dtypes)